package com.triones.api.controller.api;

import cn.dev33.satoken.annotation.SaIgnore;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.triones.api.entity.AndroidVersionMgtDO;
import com.triones.api.service.AndroidVersionMgtService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * api - 安卓版本控制
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/androidVersionMgt")
public class ApiAndroidVersionMgtController extends BaseController {

    private final AndroidVersionMgtService androidVersionMgtService;

    /**
     * 获取最新的版本信息
     */
    @GetMapping
    @SaIgnore
    public R<AndroidVersionMgtDO> getLast() {
        return R.ok(androidVersionMgtService.getLast());
    }
}
